package cz.fit.dpo.task1;

import java.util.ArrayList;
import java.util.List;

/**
 * class for representing people in this game
 */
public abstract class Person implements IHaveItem {

	/**
	 * where the person is
	 */
	protected Room inRoom;

	/**
	 * list of rooms visited
	 */
	protected List<Room> visitedRooms;

	/**
	 * list of items owned
	 */
	protected List<Item> ownedItems;

	/**
	 * constructs the person and initializes the collections
	 */
	public Person () {
		visitedRooms = new ArrayList<Room>();
		ownedItems = new ArrayList<Item>();
	}

	/**
	 * adds item to this person's bag
	 */
	public void addOwnedItem ( Item newItem ) {
		ownedItems.add (newItem);
	}
	
	/**
	 * gets the room in which the person currently is
	 */
	public Room isInRoom () {
		return inRoom;
	}

	/**
	 * gets rooms this person has visited
	 */
	public List<Room> getVisitedRooms () {
		return visitedRooms;
	}
	
	/**
	 * gets items owned by this person
	 */
	public List<Item> getOwnedItems () {
		return ownedItems;
	}
	
	/**
	 * adds a room this person has visited
	 */
	protected void addVisitedRoom ( Room visitedRoom ) {
		visitedRooms.add (visitedRoom);
	}
	
}
